#pragma once
#ifndef USERINTERFACE_H
#define USERINTERFACE_H

#include "HAPI_lib.h"

enum eChoice
{
	eChoicePlay=1,
	eChoiceOption,
	eChoiceExit,
	eChoiceOptionDifficulty,
	eChoiceOptionEasy,
	eChoiceOptionNormal,
	eChoiceOptionHard,
	eChoiceOptionSound,
	eChoiceOptionSoundOn,
	eChoiceOptionSoundOff,
	eChoiceOptionReturn	
};
class CUserInterface
{
private:
	static CUserInterface* instance;
	int indexEntityPlayer;
	int indexSpriteLife;
	int indexFrameLife;
	int indexBorderLife;
	int indexMenu;
	int indexD;
	int indexOption;
	int indexFirstEnemy;
	int indexLastEnemy;

	int timeBlendStudio;
	int timeDisplayStudio;
	int timeBeginDisplay;
	bool blendOver;
	bool displayOver;

	int timeBeginDisplayMenu;
	int timeBeginBlendD;
	int timeBlendD;
	int timeDisplayD;
	int choice;

	int tickMenu;
	int lastTick;

	HAPI_TKeyboardData* data;
protected:
	CUserInterface(void);
	~CUserInterface(void);
public:
	static CUserInterface& CUserInterface::getInstance(void);
	void CUserInterface::Initialise(int indexEntityPlayer, int indexSpriteLife, int indexFrameLife,
									int indexBorderLife, int indexSMenu, int indexSD, int indexSOption);
	void CUserInterface::Close(void);
	void CUserInterface::displayHealthPlayer(int positionX, int positionY,int totalHealth, int currentHealth, int widthBar, int heightBar);
	void CUserInterface::displayNumberOfLife(int positionX, int positionY, int numberOfLife);
	void CUserInterface::displayPoint(int positionX, int positionY);
	void CUserInterface::displayUserInterface(void);
	bool CUserInterface::displayStudio(int duration, int indexSprite, HAPI_TColour* color);
	int CUserInterface::displayMenu(void);
	int CUserInterface::displayMenuOption(void);

	//Get the input from the keyboard
	void CUserInterface::getKeyboardData(void);
	//return false if the key keyboard has been pressed or else it returns false
	bool CUserInterface::scanCode(int keyboard);

	void CUserInterface::setIndexFirstEnemy(int indexFirstEnemy);
	void CUserInterface::setIndexLastEnemy(int indexLastEnemy);
};
#define USERINT CUserInterface::getInstance()

#endif